import { post } from '@/request/http'
import store from '@/store'

// 获取 状态的下拉框数据
export const getSelectDown = (data) =>
  post(
    '/FTKJWLHYPT/base/getRefCodesByType',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            rvDomain: data.rvDomain,
            rvTerId: store.state.user.FLT_UUID_DX_H,
          }
        }
      }
    }
  )

// 获取 输单内的下拉框数据
export const getDropDown = (data) =>
  post(
    '/FTKJWLHYPT/dropDown/initSelect',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            codeType: data.rvDomain,
            value: '',
          }
        }
      }
    }
  )
// 获取 托单列表表格数据
export const getOrderListData = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/getPropManagementList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            bdcVesselname: data.enName,
            bdcVoyage: data.route,
            bdcCode: data.waterNum,
            bdcStatus: data.statu,
            startTime: data.startDay,
            endTime: data.endDay,
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: data.PageIndexs,
        },
        PageSizes: {
          FTKJWLHYPT: data.PageSizes,
        },
      }
    }
  )

// 获取 输单查询
export const inputOrderService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/getDetail',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            bdcId: data.bdcId
          }
        },
      }
    }
  )

// 获取 修改状态
export const statusService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/updateBGstatu',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            bdcId: data.bdcId,
            bdcStatus: data.bdcStatus
          }
        },
      }
    }
  )

// 获取 输单 保存
export const saveService = (data) =>
  post(
    '/FTKJWLHYPT/freightForwardBusiness/updatePropManagement',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            BgDocument: {
              bdcId: data.bdcId,
              bdcCode: data.bdcCode,
              bdcCustomsFees: data.bdcCustomsFees,
              bdcVesselname: data.bdcVesselname,
              bdcVoyage: data.bdcVoyage,
              bdcBillno: data.bdcBillno,
              bdcGoodsnumbers: data.bdcGoodsnumbers,
              bdcGoodsweight: data.bdcGoodsweight,
              bdcContractno: data.bdcContractno,
              bdcLstupduser: data.bdcLstupduser,
              bdcRemark: data.bdcRemark,
              bdcEntrytype: data.bdcEntrytype,
              bdcEntrytypeCode: data.bdcEntrytypeCode,
              bdcExportlocCode: data.bdcExportlocCode,
              bdcExportloc: data.bdcExportloc,
              bdcEnrolNo: data.bdcEnrolNo,
              bdcExportDate: data.bdcExportDate,
              bdcDeclareDate: data.bdcDeclareDate,
              bdcDeccompanyCode: data.bdcDeccompanyCode,
              bdcDeccompany: data.bdcDeccompany,
              bdcBuscompanyCode: data.bdcBuscompanyCode,
              bdcBuscompany: data.bdcBuscompany,
              bdcProduccompanyCode: data.bdcProduccompanyCode,
              bdcProduccompany: data.bdcProduccompany,
              bdcTransmodeCode: data.bdcTransmodeCode,
              bdcTransmode: data.bdcTransmode,
              bdcTradeMode: data.bdcTradeMode,
              bdcCutmodeCode: data.bdcCutmodeCode,
              bdcCutmode: data.bdcCutmode,
              bdcPaymodeCode: data.bdcPaymodeCode,
              bdcPaymode: data.bdcPaymode,
              bdcLicenseNo: data.bdcLicenseNo,
              bdcArrcountryCode: data.bdcArrcountryCode,
              bdcArrcountry: data.bdcArrcountry,
              bdcArrportCode: data.bdcArrportCode,
              bdcArrport: data.bdcArrport,
              bdcTradcountryCode: data.bdcTradcountryCode,
              bdcTradcountry: data.bdcTradcountry,
              bdcGoodssourceCode: data.bdcGoodssourceCode,
              bdcGoodssource: data.bdcGoodssource,
              bdcTransacmodeCode: data.bdcTransacmodeCode,
              bdcTransacmode: data.bdcTransacmode,
              bdcPacktypeCode: data.bdcPacktypeCode,
              bdcPacktype: data.bdcPacktype,
              bdcNetWeight: data.bdcNetWeight,
              bdcRelentryNo: data.bdcRelentryNo,
              bdcRelenrolNo: data.bdcRelenrolNo,
              bdcWarehouseNo: data.bdcWarehouseNo,
              bdcCyNo: data.bdcCyNo,
              bdcTaxcorpType: data.bdcTaxcorpType,
              bdcFreightMarkChn: data.bdcFreightMarkChn,
              bdcFreightCurrencyChn: data.bdcFreightCurrencyChn,
              bdcFreightMark: data.bdcFreightMark,
              bdcFreightRate: data.bdcFreightRate,
              bdcFreightCurrency: data.bdcFreightCurrency,
              bdcExtrasMarkChn: data.bdcExtrasMarkChn,
              bdcExtrasCurrencyChn: data.bdcExtrasCurrencyChn,
              bdcExtrasMark: data.bdcExtrasMark,
              bdcExtrasRate: data.bdcExtrasRate,
              bdcExtrasCurrency: data.bdcExtrasCurrency,
              bdcInsuranceMarkChn: data.bdcInsuranceMarkChn,
              bdcInsuranceCurrencyChn: data.bdcInsuranceCurrencyChn,
              bdcInsuranceMark: data.bdcInsuranceMark,
              bdcInsuranceRate: data.bdcInsuranceRate,
              bdcInsuranceCurrency: data.bdcInsuranceCurrency,
              bdcDeclareLocCode: data.bdcDeclareLocCode,
              bdcDeclareLoc: data.bdcDeclareLoc,
              bdcContactman: data.bdcContactman,
              bdcContacttel: data.bdcContacttel,
              bdcIetype: data.bdcIetype,
              bdcNumbers: data.bdcNumbers,
              bdcCustomsnumber: data.bdcCustomsnumber,
              bdcClearance: data.bdcClearance,
              bdcTradeModeCode: data.bdcTradeModeCode,
            }
          }
        },
      }
    }
  )
